#ifndef _BBCONTEXT_H_
#define _BBCONTEXT_H_

#include "BBObject.h"
#include <vector>

class BBContext;

class IState
{
public:
	virtual void handlerContext(BBContext* context) = 0;
};

typedef std::vector<IState*>::iterator pContextIterator;

class BBContext : public BBObject,public IState
{
public:
	BBContext(void);
	BBContext(IState* state);
	virtual ~BBContext(void);
	void handler();
	void changeContextState(IState* state);
	void addContextState(IState* state);
	IState* getCurrentContextState();
	BB_CREATE_PROPERTY(int,m_iTag,Tag);
	void clear();
protected:
	IState* m_pState;
	std::vector<IState*> m_pStateList;
};

#endif //_BBCONTEXT_H_